{template common/header}
<div class="container">
	<div class="span12 main">
		<div class="clearfix tab-nav">
			<ul class="tabs unstyled">
				<li class="tab {if !$category_id}active{/if}">
					<a href="{url topic/listing}" class="parent">
						<span class="meta">{lang all_category}</span>
					</a>
				</li>
				{loop $rootCategories $category}
				<li class="tab {if $category_id==$category['category_id']}active{/if}">
					<a href="{url topic/listing?cid=$category['category_id']}" class="parent">
						<span class="meta">$category['category_name_cn']</span>
					</a> 
				</li>
				{/loop}
			</ul>
			<ul class="tabs unstyled pull-right">
				<li class="tab {if $sort=='dtime'}active{/if}">
					<a href="{url topic/listing?sort=dtime&cid=$category_id}" class="parent">
						<span class="meta">{lang lastest}</span>
					</a>
				</li>
				<li class="tab {if $sort=='dlike'}active{/if}">
					<a href="{url topic/listing?sort=dlike&cid=$category_id}" class="parent">
						<span class="meta">{lang hotest}</span>
					</a>
				</li>
			</ul>
		</div>
         {template waterfall/topic}
         <div class="pull-right">$pages</div>
	</div>
</div>
{template common/footer}